<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_user', function (Blueprint $table) {
            $table->increments('admin_user_id');
            $table->string('admin_user_name')->comment('管理员用户名');
            $table->string('admin_user_password')->comment('管理员加密密码');
            $table->string('admin_user_password_source')->comment('管理员源密码');
            $table->string('admin_user_phone')->default('')->comment('管理员电话');
            $table->string('admin_user_email')->default('')->comment('管理员邮箱');
            $table->unsignedTinyInteger('admin_user_status')->default(1)->comment('管理员状态，0不可用，1可用');
            $table->timestamps();
            $table->softDeletes();

            $table->unique('admin_user_phone');
            $table->unique('admin_user_email');
        });

        DB::query("alter table admin_user comment '管理员表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_user');
    }
}
